package com.tyq.auth.oauth2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.code.AuthorizationCodeServices;
import org.springframework.security.oauth2.provider.code.InMemoryAuthorizationCodeServices;

/**
 * 自定义授权码模式配置策略
 *
 * @author 谭永强
 * @date 2024-05-30
 */
@Configuration
public class MyAuthorizationCodeServicesConfig {

    /**
     * 授权码存取策略
     *
     * @return 授权码存取策略
     */
    @Bean
    public AuthorizationCodeServices authorizationCodeServices() {
        //设置授权码模式的授权码如何存取，暂时采用内存方式
        return new InMemoryAuthorizationCodeServices();
    }
}
